package creational_pattern.factory.simple_factory;

public class Store {
    public Coffee order(String coffeeType) {

        CoffeeFactory factory = new CoffeeFactory();
        Coffee coffee = factory.createCoffee(coffeeType);

        coffee.addMilk();
        coffee.addSugar();

        return coffee;
    }

    // 通过静态工厂创建对象
    public Coffee orderByStaticFactory(String coffeeType) {

        Coffee coffee = StaticCoffeeFactory.createCoffee(coffeeType);

        coffee.addMilk();
        coffee.addSugar();

        return coffee;
    }
}
